package app

import "github.com/gin-gonic/gin"

/**
 * Created with Goland.
 * User: 令狐飞侠
 * Date: 2022-3-29
 * Description: gin html渲染
 */

func TestJsonRenderHtml() {
	//定义router
	router := gin.Default()

	router.Static("./static","static")
	router.LoadHTMLGlob("template/*")
	router.GET("/", rendHtml)

	//启动端口8080的服务
	router.Run(":8080")
}

func rendHtml(context *gin.Context)  {
	Content:="hello world!"
	context.HTML(200, "wellcome.html", Content)
}
